﻿using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Text;
using static xiaodingmarket_Domain.Models.EunmType;

namespace xiaodingmarket_application.ViewModel
{
    public class CommodityViewModel
    {
        /// <summary>
        /// 人id
        /// </summary>
        [Required(ErrorMessage="id不能为空")]
        public Guid StudentId { get; set; }
        /// <summary>
        /// 商品id
        /// </summary>
        [Required(ErrorMessage = "id不能为空")]
        public Guid CommodityId { get; set; }
        /// <summary>
        /// 大分类（商品or悬赏）
        /// </summary>
        public Kind Kind { get; set; }
        /// <summary>
        /// 品目分类
        /// </summary>
        public Category Category { get; set; }
        /// <summary>
        /// 设定的自动截止时间,普通商品默认为无期
        /// </summary>
        public DateTime endtime { get; set; }
        /// <summary>
        /// 备注（用户自定义标签等）)
        /// </summary>
        public string Remark { get; set; }
        /// <summary>
        /// 商品状态
        /// </summary>
        public Commoditystate State { get; set; }
        /// <summary>
        /// 商品详情
        /// </summary>
        [Required(ErrorMessage = "详情不能为空")]
        [StringLength(1000, ErrorMessage = "超出长度")]
        public string Detile { get; set; }
        /// <summary>
        /// 商品标题
        /// </summary>
        [Required(ErrorMessage = "标题不能为空")]
        [StringLength(1000, ErrorMessage = "超出长度")]
        public string Title { get; set; }
        /// <summary>
        /// 商品图片
        /// </summary>
        public string[] Img { get; set; }
        /// <summary>
        /// 商品价格
        /// </summary>
        [Range(0.00,99999999999999.99)]
        public decimal Price { get; set; }
        /// <summary>
        /// 修改人id(用来存放最终审核人信息（因为举报功能可能会有多次审核）)
        /// </summary>
        public Guid ModifyId { get; set; }
        /// <summary>
        /// 想要人数（点击按钮后再从销售子域中获得具体想要者名单）
        /// </summary>
        public int wanter { get; private set; }
        /// <summary>
        /// 浏览次数
        /// </summary>
        public int ViewsCount { get; private set; }
    }
}
